package com.itheima.reggie.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.reggie.entity.ShoppingCart;

import java.util.List;

/**
 * @author BaiXin
 */
public interface ShoppingCartService extends IService<ShoppingCart> {

    /**
     * 购物车查询
     * @param userId
     * @return
     */
    List<ShoppingCart> list(Long userId);

    /**
     * 添加购物车
     *
     * @param shoppingCart 购物车项
     * @return 添加成功的购物车项
     */
    ShoppingCart saveAndReturn(ShoppingCart shoppingCart);

    /**
     * 减少购物车
     *
     * @param shoppingCart 购物车项
     * @return 添加成功的购物车项
     */
    ShoppingCart deleteAndReturn(ShoppingCart shoppingCart);
}